package com.neusoft.demo.server;

import com.neusoft.demo.mapper.YuangongMapper;
import com.neusoft.demo.pojo.Yuangong;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RestController;

@Service
public class YuangongServer {
    @Autowired(required = false)
    YuangongMapper yuangongMapper;
    public java.util.List<Yuangong> yuangongSearch(String yname,int beginSal,int endSal){
        return yuangongMapper.yuangongSearch(yname, beginSal, endSal);
    }


    public java.util.List<Yuangong> yuangongList(){
        return  yuangongMapper.findYuangong();
    }

    public boolean updateYuangong(Yuangong yuangong){
       int n=yuangongMapper.updateYuangong(yuangong);
       if(n>0)
           return  true;
       else
           return  false;
    }

    public boolean delYuangong(int yid){
        int n=yuangongMapper.delYuangong(yid);
        if(n>0)
            return  true;
        else
            return false;
    }

    public  boolean inYuangong(Yuangong yuangong){
        int n=yuangongMapper.addYuangong(yuangong);
        if(n>0)
            return  true;
        else
            return false;

    }

    public java.util.List<Yuangong> findYuangongById(Integer id){
        return  yuangongMapper.findYuangongById(id);
    }



}
